from django.contrib import admin

# Register your models here.
from bugs.models import Bug


class BugAdmin(admin.ModelAdmin):
    list_display = ('id', 'bug_type', 'bug_probability', 'bug_desc', 'bug_recurrent', 'bug_owner', 'created_date', 'modified_date')
    exclude = ("bug_owner", "created_date", "modified_date")

    def save_model(self, request, obj, form, change):
        obj.bug_owner = request.user
        super().save_model(request, obj, form, change)


admin.site.register(Bug, BugAdmin)